import React, {Component} from 'react';
import './App.css';
import './index.css'
import {HashRouter as Router, Route,Redirect, Switch} from 'react-router-dom';
import {SpecialSale, GoodThing, BeautyMakeup, FreshFood, HomeLife, DressShoes, MotherChild, HealthCare, ShuNin,Detail,Cart,Myself,Login} from './component/View';


class App extends Component {
    constructor(props) {
        super(props)
        this.state = {}
    }

    componentDidMount() {
    }

    render() {
        return (
            <div>
                {/*路由*/}
                <Router>
                    <div>
                    <Switch>
                        <Route path='/' exact render={() => <Redirect to='/specialSale'/>}></Route>
                        <Route path='/specialSale' component={SpecialSale}></Route>
                        <Route path='/goodThing' component={GoodThing}></Route>
                        <Route path='/beautyMakeup' component={BeautyMakeup}></Route>
                        <Route path='/freshFood' component={FreshFood}></Route>
                        <Route path='/homeLife' component={HomeLife}></Route>
                        <Route path='/dressShoes' component={DressShoes}></Route>
                        <Route path='/motherChild' component={MotherChild}></Route>
                        <Route path='/healthCare' component={HealthCare}></Route>
                        <Route path='/shuNin' component={ShuNin}></Route>
                        <Route path='/detail' component={Detail}></Route>
                        <Route path='/cart' component={Cart}></Route>
                        <Route path='/myself' component={Myself}></Route>
                        <Route path='/login' component={Login}></Route>

                    </Switch>
                    </div>
                </Router>
            </div>
        );
    }
}

export default App;